<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <style>

    </style>
</head>
<body>
<button id="btnget1">发起hello请求</button>
<button id="btnget2">发起不带参数的URL请求2</button>
<script>

  $(function() {
        $('#btnget1').on('click',function() {
            $.ajax({
                type: "GET",
                url: "http://localhost:8080/hello",
                dataType: "json",
                contentType: "application/json",
                headers: {
                    'FairyCatAuthorization':'eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIzZmIzMTZjZWY3OGI0M2VlOTI0ODhjM2U4NDcyMjU3MiIsInN1YiI6IjEiLCJpc3MiOiJzemF5MjAwNSIsImlhdCI6MTc0OTM1OTA3MywiZXhwIjoxNzQ5MzYyNjczfQ.--ybqMVCPbdlAz1qBYO0_7ozcDnip-IWznLyXo5e-_U'
                },
                success:function(msg){
                    console.log(msg);
                }
            })
        })
    })


$(function() {
        $('#btnget2').on('click',function() {
            let obj={"userName":"zhangsan","password":"1234"};
            $.ajax({
                type: "POST",
                url: "http://localhost:8082/parsetoken",
                dataType: "json",
                data: JSON.stringify(obj),
                contentType: "application/json",
                headers: {
                    'Authorization':'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX25hbWUiOiJsaXNpIiwiY3JlYXRlZCI6MTY2Nzk4MjM5MzUzNiwiZXhwIjoxNjY4MDY4NzkzfQ.aQZIOx8hpOu3i3KCtuICvdAiL2Cq63GRMijBTAOnNi6jIm1_4jWDv5HeqSzQFc2TkcvfTg09yqwLFli1hMkK0A'
                },
                success:function(msg){
                    console.log(msg);
                }
            })
        })
    })

</script>

</body>
</html>